package com.yuan.spring.factoryBeantest;

import org.springframework.beans.factory.FactoryBean;

import java.lang.reflect.Proxy;

/**
 * @author yuaneg 2019/1/2
 */
public class FactoryBeanImpl implements FactoryBean<Object> {

    private Class type;

    @Override
    public Object getObject() throws Exception {
        return Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[]{UserInterfaceTest.class}, new MethodProxy());
    }

    @Override
    public Class<?> getObjectType() {
        return type;
    }

    public Class getType() {
        return type;
    }

    public void setType(Class type) {
        this.type = type;
    }
}
